<template>
  <div />
</template>
<script>
export default {
  name: 'Warning',
  props: {
    info: {
      type: String,
      default: 'false'
    }
  },
  data() {
    return {
      flag: ''
    }
  },
  mounted() {
    this.play()
    // setInterval(() => {

    // }, 1000)
  },

  methods: {
    play() {
      var msg = new SpeechSynthesisUtterance('你有一条消息请注意查收')
      msg.volume = 200
      msg.rate = 1
      msg.pitch = 1.5
      console.log(msg)
      window.speechSynthesis.speak(msg)
    },
    close() {
      console.log('触发了吗')
      this.$refs.audio.pause() // 播放
    },
    // 当音频播放
    onPlay() {
      console.log('触发了吗')
      this.audio.playing = true
    },
    // 当音频暂停
    onPause() {
      console.log('触发了吗')
      this.audio.playing = false
    }
  }
}
</script>
<style scoped="lang">

</style>
